<?php
/* 
* [***********************]
* @author: mazhenyu[houdunwangmzy@163.com]
* @Date:   2014-06-16 14:06:11
* @Last Modified time: 2014-06-16 16:01:52
*/
class CommonControl extends Control{
	/**
	 * [__init 初始化方法]
	 * @return [type] [description]
	 */
	public function __init(){
		//检测用户是否登录
		if(!isset($_SESSION['adminname']) || !isset($_SESSION['aid'])){
			go(U('Login/index'));
		}
		//获得分类数据
		$cateData = K('Category')->allCate;
		$cateData = Data::tree($cateData,'cname','cid');
		$this->assign('cateData',$cateData);
		//获得标签数据
		$tagData = K('Tag')->allTag;
		$this->assign('tagData',$tagData);
		
	}
}

